#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "database.h"
#include<QSqlTableModel>
#include<QStandardItem>
#include <QStandardItemModel>

#include<QProgressBar>
#include<QProgressDialog>


namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
    bool show_ui();
    bool init_ui();
    bool update();

protected:
        void paintEvent(QPaintEvent *);

private slots:
    void on_updateButton_clicked();


    //showButton已经由展示按钮改成了搜索按钮
    void on_showButton_clicked();

    void on_query_comboBox_currentIndexChanged(int index);

    void on_select_comboBox_currentIndexChanged(int index);

    void on_comboBox_currentIndexChanged(const QString &arg1);

private:
    Ui::MainWindow *ui;
    QSqlQueryModel*model;
    database* db;
    QProgressDialog *process;
    bool database_inited;
    QString select_college,select_type,sort_by_time;
    bool init_ui_flag,init_ui_flag_p;
};

#endif // MAINWINDOW_H
